package com.hospital.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hospital.domain.Doctor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DoctorDao extends BaseMapper<Doctor> {
    List<Doctor> selectDoctorByCondition(@Param("doctorName") String doctorName,@Param("departmentName") String departmentName);

    @Select("select * from doctorinfo where " +
            "accountNum = #{accountNum} and pwd = #{pwd}")
    Doctor login(@Param("accountNum") String accountNum,@Param("pwd") String pwd);


    @Select("select avgGrade from doctoravgscore where doctorNum = #{doctorNum}")
    Integer selectRate(String doctorNum);

    @Select("select * from doctorinfo where doctorID = #{doctorID}")
    Doctor selectDoctorByDoctorID(int doctorID);

}
